public class Singleton02 {
    private static volatile Singleton02 Instance = new Singleton02();
    private Singleton02() {

    }
    public static Singleton02 getInstance() {
        if(Instance == null) {
            synchronized (Singleton02.class) {
                if(Instance ==null) {
                    Instance = new Singleton02();
                }
            }
        }
        return Instance;
    }
}
